<?php if (!empty($num)) {
    for($i=1;$i<=$num;$i++) {
?>
        <tr>
            {loop $item['fields'] $key $name}
                <td>
                    <div class="input-group autotc" style="width:100%;">
                        <input type="text" name="tp_value_{$key}[]" class="form-control count" value="" placeholder="请填写 {$name}" {if $key=='key'}mk="1"{/if} />
                        {if $key=='key'}
                        <div class="input-group-btn" style="display: none">
                            <a class='btn btn-default btn-sm btn-add-type' style="float: right;" href="javascript:;" onclick='autonum(this)' >自动填充 <i class="fa fa-angle-double-down"></i></a>
                        </div>
                        {/if}
                    </div>
                </td>
            {/loop}
            <td>
                <a class="btn btn-default btn-op btn-operation" href="javascript:;" title="删除" onclick="removeType(this)">
                    <span data-toggle="tooltip" data-placement="top" data-original-title="删除">
                        <i class="icow icow-shanchu1"></i>
                    </span>
                </a>
            </td>
             <input type="hidden" name="tp_id[]" value="" />
        </tr>
<?php } } else { ?>
            <tr>
                    {php $data['fields'] = iunserializer($data['fields']) }
                    {if !empty($data['edit'])}
                        {loop $data['fields'] $k=>$v}
                            <td>
                                <div class="input-group autotc" style="width:100%;">
                                    <input type="text" name="tp_value_{$k}[]" class="form-control count" value="{$v}" placeholder="" {if $kk=='key'}mk="1"{/if} />
                                    {if $key=='key'}
                                    <div class="input-group-btn" style="display:none">
                                        <a class='btn btn-default btn-sm btn-add-type' style="float: right;" href="javascript:;" onclick='autonum(this)' >自动填充 <i class="fa fa-angle-double-down"></i></a>
                                    </div>
                                    {/if}
                                </div>
                            </td>
                        {/loop} 
                    {else}
                         {loop $item['fields'] $key $name}
                            <td>
                                <div class="input-group autotc" style="width:100%;">
                                    <input type="text" name="tp_value_{$key}[]" class="form-control count" value="" placeholder="请填写 {$name}" {if $key=='key'}mk="1"{/if} />
                                    {if $key=='key'}
                                    <div class="input-group-btn"  style="display: none">
                                        <a class='btn btn-default btn-sm btn-add-type' style="float: right;" href="javascript:;" onclick='autonum(this)' >自动填充 <i class="fa fa-angle-double-down"></i></a>
                                    </div>
                                    {/if}
                                </div>
                            </td>
                        {/loop}
                    {/if} 

               <td>禁止<br>删除</td>
               <input type="hidden" name="tp_id[]" value="{$data['id']}" />
           </tr>
<?php } ?>   
